#!D:/CODE/python
# -*- coding: utf-8 -*-
# @Time : 2020/6/11 11:19
# @Author : Alexdong
# @Site : 
# @File : Series.py
# @Software: PyCharm
# Functional description:

import pandas as pd
t = pd.Series([1, 2, 3, 4, 5])  # 带标签的索引


# 指定索引
t2 = pd.Series([23, 4,5,6], index=list("abcd"))
# Series是键值对的结构

print(t)
print(t2)

temp_dict = {"name": "xiaohong", "age": 18, "tel": 120086}
t3 = pd.Series(temp_dict)
print(t3)


# 如何修改series的dtype
t2.astype(float)
print(t2.dtype)

print(t3.index)
print(len(t3.index))
print(list(t3.index)[:2])


# pandas读取外部数据

file = pd.read_csv("文件路径")
print(file)



